package com.huike.web.controller.business;

import com.huike.business.domain.TbBusinessTrackRecord;
import com.huike.business.domain.vo.BusinessTrackVo;
import com.huike.business.service.ITbBusinessService;
import com.huike.business.service.ITbBusinessTrackRecordService;
import com.huike.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.huike.common.core.controller.BaseController;

import java.util.List;
import java.util.Map;

/**
 * 商机跟进记录Controller
 *
 * @date 2021-04-28
 */
@RestController
@RequestMapping("/business/record")
public class TbBusinessTrackRecordController extends BaseController {
    @Autowired
    ITbBusinessTrackRecordService iTbBusinessTrackRecordService;
    /**
     * 商机跟进记录列表
     * 方法名:/business/record/list
     * 请求方式:GET
     * @author sunyang
     */
    @GetMapping("/list")
    public AjaxResult list(TbBusinessTrackRecord tbBusinessTrackRecord){
        List<TbBusinessTrackRecord> result = iTbBusinessTrackRecordService.selectTbBusinessTrackRecordList(tbBusinessTrackRecord);
        return AjaxResult.success(result);
    }

    /**
     * 商机跟进新增
     */
    @PostMapping
    public AjaxResult insert(@RequestBody BusinessTrackVo businessTrackVo){

        int count =iTbBusinessTrackRecordService.insertBusinessTrackRecordService(businessTrackVo);
        return AjaxResult.success("新增成功");
    }

}
